<template>

  <div style="width: 100%;height: 100vh;" class="view-box f-column-Wcenter">

    <div class="form-box ">
      <h3 style="border-bottom: #ccc 2px solid;padding-bottom: 30px;">资产发行</h3>
      <div class="form ">
        <div class="f-row-between" style="width: 85%;">
          <span>项目方公司名称：{{details.company}}</span>
          <span>对标商品名称：{{details2.assetName}}</span>
          <span>抵押资产名称：{{details2.mortgage}}</span>
        </div>

        <div class="content">
          <div class="f-row-between" style="width: 40%;margin-top: 20px;">
            <div class="f-column-between">
              <span>资产发行总量</span>
              <el-input disabled style="margin-top: 10px;" v-model="details2.stAmount " maxlength="30" placeholder=""></el-input>
            </div>
            <div class="f-column-between">
              <span>流通总量</span>
              <el-input disabled style="margin-top:10px;" v-model="details2.cirAmount " maxlength="30" placeholder=""></el-input>
            </div>
          </div>
          <div class="f-row-between" style="width: 65%;margin-top: 20px;">
            <div class="f-column-between">
              <span>第一期发行量</span>
              <el-input  style="margin-top: 10px;" v-model="ruleForm1.loss_factor " maxlength="30" placeholder=""></el-input>
            </div>
            <div class="f-column-between">
              <span>第二期发行量</span>
              <el-input  style="margin-top:10px;" v-model="ruleForm1.loss_factor " maxlength="30" placeholder=""></el-input>
            </div>
            <div class="f-column-between">
              <span>第三期发行量</span>
              <el-input  style="margin-top:10px;" v-model="ruleForm1.loss_factor " maxlength="30" placeholder=""></el-input>
            </div>
          </div>
          <div class="f-column-between"  style="margin-top: 20px;height: 100px;">
            <span>资产接收地址</span>
            <el-input disabled style="margin-top:10px;" v-model="ruleForm1.loss_factor " maxlength="30" placeholder=""></el-input>
           <div>具体的发行规则请严格按照<a href="">《发行规则》</a>进行。</div>
          </div>
          <el-button style="margin-top: 20px;" type="success" plain @click="stepsBtn(10)">发布</el-button>
        </div>

      </div>
    </div>
  </div>
</template>

<script>
  import serveApi from '@/api/serveApi.js'
  export default {
    name: "Authorization",
    data() {

      return {
        userInfo: '',
        userId: '',
        url: '',
        routeData: {},
        details: {},
        details2: {},
        query1: {
          id: 0,
          applyIstoId: 0
        },

        ruleForm1: {
          id: 0,
          stAmount: '', //  发行总量
          cirAmount: '' //	number  总流通量
        },
        rules1: {
          exceed_rate: [{
            required: true,
            message: "请运算超发率",
            trigger: "blur"
          }]

        }
      }
    },
    mounted() {
      let that = this;

      that.url = process.env.VUE_APP_BASE_API;
      this.userId = this.$store.state.userInfo.id;
      this.routeData = this.$route.query
      this.getDetails();
      this.getDetails2();
    },
    methods: {
      getDetails() {
        this.query1.id = this.routeData.id;
        serveApi.applySto_id(this.query1).then(res => {
          if (res.status == "0000") {
            if (res.data) {
              this.details = res.data;
            }
          } else {
            this.$message.error(res.message);
          }
        });
      },
      getDetails2() {
        this.query1.applyIstoId = this.routeData.applyIstoId;
        serveApi.applyIsto_id(this.query1).then(res => {
          if (res.status == "0000") {
            if (res.data) {
              this.details2 = res.data;
            }
          } else {
            that.$message.error(res.message);
          }
        });
      },
      stepsBtn(e) {
          this.ruleForm1.id = this.routeData.applyIstoId;
          this.ruleForm1.status = e;
          // this.$refs.ruleForm1.validate(valid => {
          //   if (valid) {
              serveApi.applyIsto_applyIsto(this.ruleForm1).then(res => {
                if (res.data) {
                  this.$message.success('发布成功');
                } else {
                  this.$message.error(res.message);
                }
              });
          //   }
          // })
      }
    }
  }
</script>
<style scoped lang="scss">
  /* 表单的lable */
  .el-form--label-top .el-form-item__label {
    float: none;
    display: inline-block;
    text-align: left;
    padding: 0;


    font-size: 14px;
    font-family: MicrosoftYaHei;
    color: #3B3734;
  }
</style>
<style scoped lang="scss">
  .view-box {
    background-color: #ece9e7;
  }

  h6 {
    height: 73px;
    font-size: 36px;
    font-family: MicrosoftYaHeiSemibold;
    color: #3B3734;
    line-height: 48px;
    letter-spacing: 1px;
    position: relative;

    &::after {
      content: '';
      width: 66px;
      position: absolute;
      border-bottom: 2px solid #007AFF;
      bottom: 0px;
      margin-top: 25px;
    }
  }

  .form-box {
    width: 95%;
    // height: 800px;
    background: #FFFFFF;
    box-shadow: 0px 0px 10px 0px rgba(178, 178, 178, 0.2);
    border-radius: 4px;
    margin-top: 47px;
    padding: 24px;
    margin-bottom: 50px;


  }

</style>
